<script setup>
import { ref } from 'vue'
import useTodoStore from '../stores/todos'
const todoStore = useTodoStore()
</script>
<template>
    <footer class="footer">
      <span class="todo-count">剩余<strong>{{todoStore.leftCount}}</strong></span>
      <ul class="filters">
        <li>
          <a :class="{selected: todoStore.type==='all'}" href="javascript:;" @click="todoStore.setType('all')">全部</a>
        </li>
        <li>
          <a :class="{selected: todoStore.type==='no'}" href="javascript:;" @click="todoStore.setType('no')">未完成</a>
        </li>
        <li>
          <a :class="{selected: todoStore.type==='yes'}" href="javascript:;" @click="todoStore.setType('yes')">已完成</a>
        </li>
      </ul>
      <button class="clear-completed" @click="todoStore.delDone()">清除已完成</button>
    </footer>
  </template>
